home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 March / SOFM_Mar1995.bin / mac / General Interest / KeyQuencer 1.2.1 / Developer’s toolkit / Extension code / A4Globals.h next >
Text File  |  1994-11-23  |  2KB  |  47 lines

  1. // =============================================================================
  2. // KEYQUENCER EXTENSIONS A4 GLOBAL STORAGE - VERSION 1.2.1 - NOVEMBER 1994
  3. // ⌐1994 Alessandro Levi Montalcini <LMontalcini@pmn.it>
  4. // Don╒t forget to send me any cool extensions you create!
  5. // This text looks best in monaco 9 font, 4 spaces per tab, no wrapping
  6.  
  7. #ifndef _H_a4globals
  8. #define _H_a4globals
  9.  
  10. //==============================================================================
  11.  
  12.     #if defined(powerc) || defined(__powerc)        // powerpc
  13.     
  14.         #define MAIN_SETUP_GLOBALS(x)    { x = 0; }  // to avoid "unused var" warnings
  15.         #define MAIN_RESTORE_GLOBALS(x)
  16.         #define TEMP_SETUP_GLOBALS(x)    { x = 0; }
  17.         #define TEMP_RESTORE_GLOBALS(x)
  18.     
  19.     #elif defined(THINK_C)                            // think c
  20.     
  21.         #include <SetUpA4.h>
  22.         #define MAIN_SETUP_GLOBALS(x)    { RememberA0(); SetUpA4(); asm { MOVE.L (A7)+, x } }
  23.         #define MAIN_RESTORE_GLOBALS(x)    { asm { MOVE.L x, -(A7) } RestoreA4(); }
  24.         #define TEMP_SETUP_GLOBALS(x)    { SetUpA4(); asm { MOVE.L (A7)+, x } }
  25.         #define TEMP_RESTORE_GLOBALS(x)    { asm { MOVE.L x, -(A7) } RestoreA4(); }
  26.         
  27.     #elif defined(__MWERKS__)                        // code warrior
  28.     
  29.         #include <A4Stuff.h>
  30.         #include <SetUpA4.h>
  31.         #define MAIN_SETUP_GLOBALS(x)    { x = SetCurrentA4(); RememberA4(); }
  32.         #define MAIN_RESTORE_GLOBALS(x)    { (void)SetA4(x); }
  33.         #define TEMP_SETUP_GLOBALS(x)    { x = SetUpA4(); }
  34.         #define TEMP_RESTORE_GLOBALS(x)    { (void)RestoreA4(x); }
  35.     
  36.     #else                                            // unknown compiler, stop here
  37.     
  38.         #error unsupported compiler
  39.     
  40.     #endif                                            // end of compiler-specific stuff
  41.  
  42. //==============================================================================
  43.  
  44. #endif // _H_a4globals
  45.  
  46. //==============================================================================
  47.